<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浅拷贝测试</title>
    <script src="../../src/object/clone.js"></script>
</head>
<body>
    <script>
        const obj = { x: 'abc', y: {m: 1} };
        // const obj = [1,2,3,4];

        // const result = clone1(obj);
        const result = clone2(obj);

        //修改新数据中某个引用类型的值
        // result.y.m = 2;

        console.log(obj);
        console.log(result);
        console.log(obj === result);
    </script>
</body>
</html>